package com.example.drawex;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class BitmapScaleActivity extends Activity {

	
	// 확대, 축소 비율
	float scale=1.0f;
	
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_bitmap_scale);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// TODO Auto-generated method stub
		
		new OptionMenu(this, item);
		
		return super.onOptionsItemSelected(item);
	}

	


	public void setScale(View v) {
		switch(v.getId()) {
		case R.id.button1:
			scale += 0.1f;
			break;
		case R.id.button2:
			scale -= 0.1f;
			break;
				
		}
		
		BitmapScaleView bsv = (BitmapScaleView)findViewById(R.id.view1);
		bsv.setScale(scale);
	}

}
